Use a separate DB for worker jobs (LG-4905)#5275
Merged
zachmargolis merged 17 commits intomainfrom Aug 23, 2021
Merged
Conversation
- StaleJobError added in #5244
zachmargolis
commented
Aug 9, 2021
zachmargolis
commented
Aug 9, 2021
Comment on lines
+1
to
+2
| # same as 20210804180216_create_good_jobs.rb but runs in the worker database | ||
| class CreateGoodJobsSeparateDatabase < ActiveRecord::Migration[5.2] |
Contributor
Author
There was a problem hiding this comment.
note in this one it's in db/worker_jobs_migrate instead of db/migrate or db/primary_migrate
zachmargolis
commented
Aug 9, 2021
| development: | ||
| primary: | ||
| <<: *defaults | ||
| migrations_paths: db/primary_migrate |
Contributor
Author
There was a problem hiding this comment.
the default is db/migrate but specifying this makes sure we don't run the old migrations in the jobs-only DB, complete separation of DBs
zachmargolis
commented
Aug 17, 2021
Comment on lines
74
to
76
| t.integer "user_id", null: false | ||
| t.string "encrypted_code", default: "", null: false | ||
| t.string "code_fingerprint", default: "", null: false | ||
| t.string "encrypted_code", default: "", null: false | ||
| t.datetime "used_at" |
Contributor
Author
There was a problem hiding this comment.
this is just from doing a full drop/recreat, basically a true-up of this file
mitchellhenke
approved these changes
Aug 19, 2021
stevegsa
reviewed
Aug 19, 2021
| @@ -0,0 +1,7 @@ | |||
| # rubocop:disable Rails/ApplicationRecord | |||
| class WorkerJobApplicationRecord < ActiveRecord::Base | |||
Contributor
There was a problem hiding this comment.
do we need coverage here?
Contributor
Author
There was a problem hiding this comment.
this class is actually used, the GoodJob::Job dynamically subclasses it, however that may be set up before the code coverage is set up
If this class was not used, GoodJob would look in the wrong DB for its table
stevegsa
approved these changes
Aug 19, 2021
Contributor
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Do not merge until https://github.com/18F/identity-devops/pull/3689 is deployed)Builds on top of
Starting with this PR, we have two
schema.rbsActiveRecord::Baseclass